﻿/// <reference path="http://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js" />
/// <reference path="SimplePointsMap.js" />

//this file is used for loading the initial controls for the page, in this case just one, but
//becomes more useful when you want to create various controls at page load

//magic asp.net ajax function that loads on dom ready
function pageLoad() {
    // create our map control using ASP.NET Ajax's $create method, passing bing maps key, initial latitude,
    // longitude and zoom levels from hidden input fields in the html page. ASP.NET ajax does some magic 
    // so that the properties defined in our SimplePointsMap control (like set_BingmapsKey) are set in
    // the $create method below by giving the property name without the _set

    //see http://msdn.microsoft.com/en-us/library/bb397487.aspx for full documentation of $create method
    $create(WebSericeBingMaps.SimplePointsMap, {
        BingmapsKey: $get("bingmapskey").value,
        Latitude: parseFloat($get("latitude").value),
        Longitude: parseFloat($get("longitude").value),
        Zoom: parseFloat($get("zoom").value)
    }, null, null, $get("mapDiv"));
}